standard_work_days = 22

basic_salary = float(input("\nEnter the monthly base salary: "))
actual_work_days = float(input("Enter the actual number of work days in the month: "))
leave_days = float(input("Enter the number of leave days: "))
overtime_days = float(input("Enter the number of overtime days: "))

if leave_days <= 2:
    deduction = 0
elif leave_days <= 7:
    deduction = basic_salary * 0.10
elif leave_days <= 14:
    deduction = basic_salary * 0.50
else:
    deduction = basic_salary

if actual_work_days == standard_work_days:
    bonus = basic_salary * 0.20
else:
    bonus = 0

daily_salary = basic_salary / actual_work_days
overtime_pay = overtime_days * daily_salary

final_salary = basic_salary - deduction + bonus + overtime_pay

print(f"The final salary for the month is: {final_salary:.2f}\n")